//
//  MyListTableViewCell.m
//  ShouYi
//
//  Created by yrapp on 16/3/16.
//  Copyright © 2016年 yurui. All rights reserved.
//

#import "MyListTableViewCell.h"

@implementation MyListTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
 
        UIView *white = [[UIView alloc] initWithFrame:CGRectMake(0, 10, kWidth, 167.5)];
        white.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:white];
        
        _dingdanLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, 180, 12)];
        _dingdanLabel.text = @"订单编号: 1234567897455";
        _dingdanLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_dingdanLabel];
        
        _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth - 100, _dingdanLabel.frame.origin.y, 90, 12)];
        _stateLabel.text = @"卖家已发货";
        _stateLabel.textAlignment = NSTextAlignmentRight;
        _stateLabel.font = [UIFont systemFontOfSize:12];
        _stateLabel.textColor = [UIColor redColor];
        [self.contentView addSubview:_stateLabel];
        
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(10, 40, kWidth - 20, 1)];
        lineView.backgroundColor = [UIColor colorWithRed:237.0/255 green:237.0/255 blue:237.0/255 alpha:1];
        [self.contentView addSubview:lineView];
        
        _titleImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 50, 87, 87)];
        [self.contentView addSubview:_titleImageView];
        _titleImageView.backgroundColor = [UIColor yellowColor];
        
        UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake(10, 147 , kWidth - 20, 1)];
        lineView1.backgroundColor = [UIColor colorWithRed:244.0/255 green:244.0/255 blue:244.0/255 alpha:1];
        [self.contentView addSubview:lineView1];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleImageView.frame.size.width + _titleImageView.frame.origin.x + 10, _titleImageView.frame.origin.y, 124, 30)];
        _titleLabel.font  = [UIFont systemFontOfSize:12];
        _titleLabel.text = @"德国WMF福腾宝Work双耳中式不锈钢炒锅 32com";
        _titleLabel.numberOfLines = 0;
        _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
        [self.contentView addSubview:_titleLabel];
        
        _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth - 80, _titleLabel.frame.origin.y, 70, 12)];
        _priceLabel.text = @"￥ 189.00";
        _priceLabel.font = [UIFont systemFontOfSize:12];
        _priceLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_priceLabel];
        
        _numLabel = [[UILabel alloc] initWithFrame:CGRectMake(_priceLabel.frame.origin.x, _priceLabel.frame.origin.y + 15, 70, 12)];
        _numLabel.textAlignment = NSTextAlignmentRight;
        _numLabel.font = [UIFont systemFontOfSize:12];
        _numLabel.text = @"X2";
        _numLabel.textColor = [UIColor colorWithRed:106.0/255 green:106.0/255 blue:106.0/255 alpha:1];
        [self.contentView addSubview:_numLabel];
        
        _classLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.size.height + _titleLabel.frame.origin.y + 10, 124, 12)];
        _classLabel.text = @"颜色分类:红色,尺寸:L";
        _classLabel.font = [UIFont systemFontOfSize:12];
        _classLabel.textColor = [UIColor colorWithRed:106.0/255 green:106.0/255 blue:106.0/255 alpha:1];
        [self.contentView addSubview:_classLabel];
        
        _hejiLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 157, kWidth - 20, 12)];
        _hejiLabel.font = [UIFont systemFontOfSize:12];
        _hejiLabel.text = @"共2件商品 合计: ￥189.00(含运费￥0.00)";
        _hejiLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_hejiLabel];
                
        _footView = [[UIView alloc] initWithFrame:CGRectMake(0,_hejiLabel.frame.origin.y + 10 + 10, kWidth, 30)];
        _footView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_footView];
        
        UIView *footLine = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kWidth - 20 , 1)];
        footLine.backgroundColor = [UIColor colorWithRed:244.0/255 green:244.0/255 blue:244.0/255 alpha:1];
        [_footView addSubview:footLine];
        
        
        _rightlButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _rightlButton.frame = CGRectMake(kWidth - 85, 5, 75, 20);
        [_rightlButton setTitle:@"立即支付" forState:(UIControlStateNormal)];
        [_rightlButton setTitleColor:[UIColor redColor] forState:(UIControlStateNormal)];
        _rightlButton.titleLabel.font = [UIFont systemFontOfSize:12];
        _rightlButton.layer.borderColor = [UIColor redColor].CGColor;
        _rightlButton.layer.borderWidth = 1;
        _rightlButton.layer.cornerRadius = 3;
        [_footView addSubview:_rightlButton];
        
        _leftButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _leftButton.frame = CGRectMake(kWidth - 85 * 2, 5, 75, 20);
        [_leftButton setTitle:@"取消订单" forState:(UIControlStateNormal)];
        [_leftButton setTitleColor:[UIColor grayColor] forState:(UIControlStateNormal)];
        _leftButton.titleLabel.font = [UIFont systemFontOfSize:12];
        _leftButton.layer.borderColor = [UIColor grayColor].CGColor;
        _leftButton.layer.borderWidth = 1;
        _leftButton.layer.cornerRadius = 3;
        [_footView addSubview:_leftButton];

        

    }
    
    return self;
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
